// types
const SET_DATA = "SET_DATA"; // 设置列表数据
const VSIBLE_SWITCH = "VSIBLE_SWITCH"; // 二级弹窗显隐
const SET_BRANCH_DATA = "SET_BRANCH_DATA"; // 设置支行数据
export default {
    namespaced: true,
    state: {
        outerVisible: false, // 一级弹窗显隐
        innerVisible: false, // 二级弹窗显隐
        // 代理商
        agentDialog: false,
        agentId: "", // 代理商id
        agentData: [] // 代理商列表
    },
    actions: {},
    getters: {
        outerVisible: state => state.outerVisible,
        innerVisible: state => state.innerVisible,
        agentDialog: state => state.agentDialog,
        agentId: state => state.agentId
    },
    mutations: {
        [SET_DATA](state, payload) {
            state[payload.key] = payload.value;
        },
        [VSIBLE_SWITCH](state, payload) {
            if (payload.openType) {
                state.openType = payload.openType.toString();
            }
            state[payload.key] = payload.value;
        },
        ["CLEAR_SELECT"](state, payload) {
            state[payload.key] = "";
        },
        [SET_AGENT_DATA](state, payload) {
            state.agentData = payload.agentData;
        },

        [SET_AGENT_ID](state, payload) {
            state.agentId = payload.agentId;
            state.agentDialog = false;
        }
    }
};
